package com.xiguanlezz.cn.client.naming.remote.grpc.redo.data;

import com.xiguanlezz.cn.api.naming.pojo.Instance;

/**
 * @Author：习惯了种种
 * @CreateDate：2024/11/25 15:15
 * @Description：服务注册与服务注销重试实体类
 */
public class InstanceRedoData extends RedoData<Instance> {
    protected InstanceRedoData(String serviceName, String groupName) {
        super(serviceName, groupName);
    }

    protected InstanceRedoData(String serviceName, String groupName, boolean expectedRegistered) {
        super(serviceName, groupName, expectedRegistered);
    }

    public static InstanceRedoData build(String serviceName, String groupName, Instance instance) {
        InstanceRedoData instanceRedoData = new InstanceRedoData(serviceName, groupName);
        instanceRedoData.setData(instance);
        return instanceRedoData;
    }

    public static InstanceRedoData buildWithExpectedStatus(String serviceName, String groupName, boolean expectedRegistered, Instance instance) {
        InstanceRedoData instanceRedoData = new InstanceRedoData(serviceName, groupName, expectedRegistered);
        instanceRedoData.setData(instance);
        return instanceRedoData;
    }
}
